from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import os
import traceback

class MainHandler(webapp.RequestHandler):
  def get(self):
    info = "<p>APPLICATION_ID:%s</p>"%os.environ['APPLICATION_ID']
    info += "<p>REMOTE_ADDR:%s</p>"%os.environ['REMOTE_ADDR']
    info +=  "<p>HTTP_USER_AGENT:%s</p>"%os.environ['HTTP_USER_AGENT']
    info += "<p>PATH_INFO:%s</p>"%os.environ['PATH_INFO']
    
    self.response.headers['Content-Type'] = 'text/html'
    self.response.out.write("""
<html>
<head><title>public wallproxy-fixed servers</title>
<style type="text/css">
body {
  font-family: monospace;
  background-color: #f5f5f5;
  font-size: 10pt;
  margin: 0.5em;
  padding: 0.5em;
  padding-right: 0em;
  overflow-x: hidden;
}
</style>
</head>
<body>
<p>This is a public wallproxy-fixed servers.</p>
<p>please vist <a href="http://you-proxy.googlecode.com/">you-proxy</a></p>"""+info+"""
<p>
<a href="http://code.google.com/appengine/">
<img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" 
tyle="vertical-align: middle" /></a></p>
</body></html>""")

def main():
    application = webapp.WSGIApplication([
    ('/.*', MainHandler),
    ], debug=True)
    run_wsgi_app(application)

if __name__ == '__main__':
  try:
    main()
  except:
    traceback.print_stack()
